home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 6⁄1⁄90 / 1365-Re Assignment to var-May90 < prev    next >
Encoding:
Text File  |  1990-06-01  |  993 b   |  32 lines  |  [TEXT/GEOL]

  1. Item    2406519                         29-May-90        13:50PDT
  2.  
  3. From:   WILSON6                         Wilson, Dave-Personal Concepts,VCA
  4.  
  5. To:     D5295                           Reseach SW Design, D Goldman,PRT
  6.  
  7. cc:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    Re: Assignment to vars
  10.  
  11. Dave,
  12.  
  13. With regard to assigning the result of a funciton call to an instance variable,
  14. such as:
  15.  
  16.     fVariable := MyFunction;
  17.  
  18. You are safe. Probably. As long as you know your compiler. And never change to
  19. one you don't know.
  20.  
  21. My understanding is that MPW Pascal 2.0 would dereference SELF before the
  22. function was called, making the call dangerous.  MPW 3.0 does it the other way,
  23. so you are safe. I do not know how THINK Pascal treats it.
  24.  
  25. I believe it is dangerous to write code that depends on the details of how your
  26. compiler works - hence I like to return the function result into a local
  27. variable. I think it makes the code more maintainable in the long run.
  28.  
  29. Dave
  30.  
  31.  
  32.